// components/popup-search-condition/popup-search-condition.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    isPopupVisible: {
      type: Boolean,
      value: false
    },
    licensePlateNum: {
      type: String,
      value: ""
    },
    flowCode: {
      type: String,
      value: ""
    },
    customer: {
      type: String,
      value: ""
    },
    startTime: {
      type: String,
      value: ""
    },
    endTime: {
      type: String,
      value: ""
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    
  },
  observers: {
    'isPopupVisible': function (selectIndex) {
      // 在 rate被设置时，执行这个函数
      console.log(this.data.isPopupVisible)
      if (this.data.isPopupVisible == true) {
        
      }
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    search: function () {
      this.setData({
        isPopupVisible: false
      })
      this.triggerEvent('search', {
        startTime: this.data.startTime,
        endTime: this.data.endTime,
        licensePlateNum: this.data.licensePlateNum,
        flowCode: this.data.flowCode,
        customer: this.data.customer
      });
    },
    closePopup: function () {
      this.setData({
        isPopupVisible: false
      })
    },
    handleStartTimeChange: function (e) {
      this.setData({
        startTime: e.detail.date
      })
    },
    handleEndTimeChange: function (e) {
      this.setData({
        endTime: e.detail.date
      })
    },
    inputLicensePlateNumChange(e) {
      this.setData({
        licensePlateNum: e.detail.value
      })
    },
    inputFlowCodeChange(e) {
      this.setData({
        flowCode: e.detail.value
      })
    },
    inputCustomerChange(e) {
      this.setData({
        customer: e.detail.value
      })
    }
  }
})